<template>
  <view class="my-search-container" @click="searchBoxHandler">
    <view class="my-search-box">
      <!--使用 uni-ui 提供的图标组件-->
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
  
</template>
<script>
  export default{
    methods: {
      searchBoxHandler(){
        console.log('~~~~~~~~~~~');
        //'myclick' 是自定义事件的名称，父组件可以通过监听这个事件来执行相应的逻辑。
        this.$emit('myclick')
      }
    }
  }
  
</script>
<style lang="scss">
  .my-search-container {
    height: 60px;
    background-color: #f7fff2;
    display: flex;
    align-items: center;
    padding:0 10px;
    .my-search-box{
      height: 36px;
      background-color: #ffffff;
      border-radius: 18px;
      width: 100%;
      border: 1px solid black;
      display: flex;
      justify-content: center;
      align-items: center;
      .placeholder{
        font-size: 15px;
        margin-left: 5px;
      }
    }
  }
</style>
